/*------------------------------------------------------------------------
 # Filtering Articles - Version 1.0
 # Copyright (c) 2011 YouTech Company. All Rights Reserved.
 # @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 # Author: YouTech Company
 # Websites: http://www.smartaddons.com
 -------------------------------------------------------------------------*/
(function($){
   $.fn.filter = function(options) {
        var defaults = {
			allcate:'',
			discounted:'',
			catpicker: '',
			filter:''	
		};
	
	  //Extend those options
	var options = $.extend(defaults, options); 

   $(options.discounted)
        .css("opacity","0.8")
       .hover(function(){
           $(this).css("opacity","1");
       }, function() {
           $(this).css("opacity","0.8");
       })
       /*.click(function(){
           location.href = $(this).attr("rel"); 
           return false;
       }) 
       
       UNCOMMENT THIS TO MAKE THE BLOCKS CLICKABLE TO THEIR REL ATTRIBUTES    
       */;
   $(options.filter).click(function(){ 
		var thisFilter =  $(this).attr('href'); 
		thisFilter = thisFilter.replace("#", "");     
        $(options.discounted).slideUp();
        $("."+ thisFilter).slideDown();
        $(options.catpicker).removeClass("current");
        $(this).addClass("current");
        return false;
   });

};
})($jsmart||jQuery)